package cn.readjava.bean;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "article_category", schema = "readjava", catalog = "")
public class ArticleCategory implements Serializable {
    private long acId;
    private String acTitle;
    private String acIcon;
    private String acIntroduce;
    private Integer acState;

    @Id
    @Column(name = "ac_id", nullable = false)
    public long getAcId() {
        return acId;
    }

    public void setAcId(long acId) {
        this.acId = acId;
    }

    @Basic
    @Column(name = "ac_title", nullable = true, length = 255)
    public String getAcTitle() {
        return acTitle;
    }

    public void setAcTitle(String acTitle) {
        this.acTitle = acTitle;
    }

    @Basic
    @Column(name = "ac_icon", nullable = true, length = 255)
    public String getAcIcon() {
        return acIcon;
    }

    public void setAcIcon(String acIcon) {
        this.acIcon = acIcon;
    }

    @Basic
    @Column(name = "ac_introduce", nullable = true, length = 255)
    public String getAcIntroduce() {
        return acIntroduce;
    }

    public void setAcIntroduce(String acIntroduce) {
        this.acIntroduce = acIntroduce;
    }

    @Basic
    @Column(name = "ac_state", nullable = true)
    public Integer getAcState() {
        return acState;
    }

    public void setAcState(Integer acState) {
        this.acState = acState;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ArticleCategory that = (ArticleCategory) o;
        return acId == that.acId &&
                Objects.equals(acTitle, that.acTitle) &&
                Objects.equals(acIcon, that.acIcon) &&
                Objects.equals(acIntroduce, that.acIntroduce) &&
                Objects.equals(acState, that.acState);
    }

    @Override
    public int hashCode() {

        return Objects.hash(acId, acTitle, acIcon, acIntroduce, acState);
    }
}
